package com.firexxx.common.utils;

import java.util.Objects;

/**
 * @description: TODO
 * @throws:
 * @author: zhuangzhang2
 * @date: 2019/12/24 10:29
 */
public class ExceptionExt {
    ExceptionExt() {
    }

    public static String getMergedMessage(Throwable exp) {
        if (exp == null) {
            return null;
        } else {
            return exp.getCause() == null ? exp + ";" + Objects.toString(exp.getMessage(), "") : exp.getMessage() + getMergedMessage(exp.getCause());
        }
    }
}